home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-03-03 | 998 b | 36 lines | [TEXT/ALFA] |
-
- ( Scribble.4th -- Draw on the screen while the mouse button down, )
- ( exit when the * clicked )
-
- ( RTK, MacQForth, assumes 'extend.4th' already loaded )
-
- ( 03/03/95 )
-
-
- : it ; ( type 'forget it' before loading a new demo file )
-
- : done? ( -- b ) ( true if the mouse button on and in the * )
- @mouse rot rot ( keep button status )
- dup >r 243 > r> 271 < and swap ( check y range )
- dup >r 0 > r> 20 < and ( check x range )
- and and if
- true ( ready to exit )
- else
- false ( not done )
- then
- ;
-
- : go ( scribble )
- page ." SCRIBBLE. Draw with the mouse, click in the * to exit."
- 23 cv 1 ch 42 emit ( draw a star, ASCII 42 = '*' )
- begin
- done? not ( while not done )
- while
- @mouse if ( get the mouse and button status )
- plot ( plot the point )
- else
- drop drop ( otherwise drop the coordinates )
- then
- repeat
- ;
-